package com.yx1996.management.Config;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@Configuration//代表这个是一个配置文件
@ComponentScan(basePackages = "com.yx1996.management.*")//自动扫描
@EnableAspectJAutoProxy(proxyTargetClass = true)//启用aop
public class SpringRootConfig implements ApplicationContextAware {
    static ApplicationContext applicationContext;

    public static ApplicationContext getApplicationContext() {
        return applicationContext;
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }

}
